<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>SendDlgMessage</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../styles/styles.css">
<script language="javascript" src='../links.js' type="text/javascript"></script>
</head>

<body>

<h1>SendDlgMessage</h1>
<div class=navbar>
<a href="../index.html">main</a> |
<a href="index.html">Dialog API</a>
<a href="dmsg/index_dm.html">Messages</a><br>
</div>

<div class=shortdescr>
The <dfn>SendDlgMessage</dfn> function is used to send a message to the dialog callback function.
</div>

<pre class=syntax>
LONG_PTR WINAPI SendDlgMessage(
  HANDLE hDlg,
  int    Msg,
  int    Param1,
  LONG_PTR Param2
);
</pre>

<h3>Arguments</h3>
<div class=descr>
  <div class=dfn>hDlg</div>
  <div class=dfndescr>Dialog handle</div>

  <div class=dfn>Msg</div>
  <div class=dfndescr>One of the Dialog API <a href="dmsg/index.html#DialogMessages">messages</a>.</div>

  <div class=dfn>Param1</div>
  <div class=dfndescr>The 1st parameter.</div>

  <div class=dfn>Param2</div>
  <div class=dfndescr>The 2nd parameter.</div>
</div>

<h3>Return value</h3>
<div class=descr>
Return value depends on Msg value.
</div>


<h3>Example</h3>
<div class=descr>
A fragment from the Reversi game dialog callback proc:
<pre class=code>LONG_PTR WINAPI ReversiDialogProc(HANDLE hDlg, int Msg,int Param1,LONG_PTR Param2)
{
...
    case DN_INITDIALOG:
      //get element info
      Info.SendDlgMessage(hDlg,DM_GETDLGITEM,75,(LONG_PTR)&amp;DialogItem);
      ListItems=DialogItem.ListItems-&gt;Items;
      ...
      NewGame(hDlg);
      return FALSE;
...
}</pre>
</div>

<div class=see>See also:</div><div class=seecont>
<a href="dialogex.html">DialogEx</a>,
<a href="defdlgproc.html">DefDlgProc</a>
</div>

</body>
</html>